#include <iostream>
#include <string>

using namespace std;

class Complex
{
private:
    double real; // 实部
    double imag; // 虚部

public:
    // 构造
    Complex()
        : real(0), imag(0)
    {
    }
    Complex(double real, double imag)
        : real(real), imag(imag)
    {
    }
    // 析构
    ~Complex() {}

public:
    // 显示
    void Show()
    {
        cout << "实部" << real << "虚部" << imag << endl;
    }

public:
    // 单目运算符   !a
    bool operator!() const
    {
        bool b = !(this->imag + this->real);
        return b;
    }

    // 左移  cout << O
    friend ostream & operator<<(ostream& os , const Complex & O);

};

// os 输出流
ostream & operator<<(ostream& os , const Complex & O)
{
    os << "实部" << O.real << "虚部" << O.imag;
    return os;
}

int main(int argc, char const *argv[])
{
    Complex F(10 , 20);
    bool b = !F;

    cout << F << endl;
    return 0;
}
